//
//  UserModel.m
//  ZT_iOS
//
//  Created by Brigitte on 2017/2/22.
//  Copyright © 2017年 Brigitte. All rights reserved.
//

#import "UserModel.h"
#import "NSObject+ZTNotNull.h"

#import "MJExtension.h"
#import "ZTMacros.h"

@implementation UserModel
//软测问题
//替换参数
+ (NSDictionary *)mj_replacedKeyFromPropertyName
{
    return @{
//             @"telePhone" : @"telephone",
             @"uzId"    : @"id"
             };
}
//给属性赋值时，防止崩溃
- (void)setValue:(id)value forUndefinedKey:(NSString *)key{
    
}

//-(NSString *)telephone
//{
//    if ([_telephone isNotEmpty]) {
//        return _telephone;
//    }
//    return _telePhone;
//}

-(NSString *)userId
{
    if ([_userId isNotEmpty]) {
        return _userId;
    }else if ([_uid isNotEmpty]){
        return _uid;
    }else{
        _userId = _uzId;
        return _uzId;
    }
}

-(NSString *)picture
{
    if ([_picture containsString:@"http"]) {
        return _picture;
    }else{
        return [NSString stringWithFormat:@"%@%@",[kUserDefaults objectForKey:EmployeeOrgBaseUrl],_picture];
    }
}

-(NSString *)qrcode
{
    if ([_qrcode containsString:@"http"]) {
        return _qrcode;
    }else{
        return [NSString stringWithFormat:@"%@%@",[kUserDefaults objectForKey:EmployeeOrgBaseUrl],_qrcode];
    }
}
@end
